<script setup>
import { provide, ref } from 'vue';
import FatherComp from './components/FatherComp.vue';

const money = ref(100)
// 跨组件传值
provide('money',money)
const changeMoney = (newMoney) => {
  money.value += newMoney
}
provide('changeMoney',changeMoney)
</script>

<template>
  <div class="app-page" style="border: 10px solid #ccc; padding: 50px; width: 600px">
    app 组件 {{ money }}
    <FatherComp />
  </div>
</template>

<style scoped></style>